#pragma once

#include <QtWidgets/QMainWindow>
#include <QXmlStreamWriter>
#include <QHash.h>
#include "ui_QtWidgetsApplication1.h"
#include "DocumentCommon.h"
#include "View.h"

class QtWidgetsApplication1 : public QMainWindow
{
    Q_OBJECT

public:
    QtWidgetsApplication1(QWidget *parent = Q_NULLPTR);

private:
    Ui::QtWidgetsApplication1Class ui;
	QString loadedProjectFilePath;
	QHash<QString, QString> parameters;
	bool unsaved;

private:
	void setUpEventHandlers();
	void refreshUI();
	bool writeProjectFile(QString path);
	bool readProjectFile(QString path);
	void writeParamToXML(QXmlStreamWriter &stream, const QString &key, const QString &value);
	void resetEditValue(QLineEdit *edit);
	void fakeGenerateTclScript(const QString &occ_path, const QString &dst);

private slots:
	void onRunClicked();
	void onRunClicked2();
	void onSaveClicked();
	void onSaveAsClicked();
	void onLoadClicked();
	void onEditChanged(const QLineEdit *edit);

private:
	DocumentCommon* myDocument3d;
	View* myView3d;
};
